package com.xiaoge;

import com.xiaoge.circulardependency.AService;
import com.xiaoge.invokeflow.WolfDog;
import org.springframework.context.annotation.*;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.HashMap;
import java.util.Map;

/**
 * TODO  jvm需要加 -javaagent:D:/worksprace/SpringFamilyMeals/spring/spring-framework-5.3.18/spring-instrument/build/libs/spring-instrument-5.3.18.jar
 *
 * @author <a href="mailto:1330137071@qq.com">Zhang Xiao</a>
 * @since
 */
//@EnableAsync
//@EnableCaching
//@EnableMBeanExport
//@Configuration
//@EnableAspectJAutoProxy
//@EnableTransactionManagement
//@ComponentScan(basePackages = "org.springframework")
public class ZhangXiaoIOC {

//	@Bean
//	public CacheManager cacheManager() {
//		return new ConcurrentMapCacheManager();
//	}


	public static void main(String[] args) {
		// 创建 ApplicationContext 容器
		AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(AppConfig.class);
//		ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("spring.xml");

//		WolfDog wolfDog = (WolfDog)applicationContext.getBean("wolfDog");
//		System.out.println(wolfDog);

		AService aService = (AService)applicationContext.getBean("AService");
		System.out.println(aService);

//		Car car = (Car)applicationContext.getBean("car");
//		System.out.println(car);
//		Car.Cat cat = (Car.Cat)applicationContext.getBean("car.Cat");
//		System.out.println(cat);
	}
}